# $Id$
# Maintainer: Tom Killian <tom@archlinux.org>
# Committer: dorphell <dorphell@archlinux.org>

pkgname=libtheora
pkgver=1.1.1
pkgrel=4
pkgdesc="An open video codec developed by the Xiph.org"
arch=('x86_64')
url="https://www.theora.org/"
license=('BSD')
depends=('libogg')
makedepends=('libvorbis')
source=(https://downloads.xiph.org/releases/theora/libtheora-${pkgver}.tar.bz2
        libtheora-1.1.1-libpng16.patch)
sha256sums=('b6ae1ee2fa3d42ac489287d3ec34c5885730b1296f0801ae577a35193d3affbc'
            'e4c9a8dc798c596ed32a2a720020ae27a0e72f5add1a47cb8fadebe0e7180d7e')

prepare() {
  cd ${pkgname}-${pkgver}
  patch -Np0 -i ../libtheora-1.1.1-libpng16.patch
}

build() {
  cd ${pkgname}-${pkgver}
  ./configure --prefix=/usr --enable-shared --disable-static
  make
}

package() {
  cd ${pkgname}-${pkgver}
  make DESTDIR="${pkgdir}" install

  install -m755 -d "${pkgdir}/usr/share/licenses/${pkgname}"
  install -m644 LICENSE COPYING "${pkgdir}/usr/share/licenses/${pkgname}/"
}
